
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    active: -1,
    list: [
      {
        "pagePath": "pages/index/index",
        "text": "首页",
        "iconPath": "/icons/home.png",
        "selectedIconPath": "/icons/home_active.png"
      },
      {
        "pagePath": "pages/my-group/my-group",
        "text": "团队",
        "iconPath": "/icons/my-group.png",
        "selectedIconPath": "/icons/my-group-active.png"
      },
      {
        "pagePath": "pages/shop/shop",
        "text": "商城",
        "iconPath": "/icons/shop.png",
        "selectedIconPath": "/icons/shop_active.png"
      },
      {
        "pagePath": "pages/video/video",
        "text": "营视动效",
        "iconPath": "/icons/video.png",
        "selectedIconPath": "/icons/video_active.png"
      },
       {
        "pagePath": "pages/user/user",
        "text": "个人中心",
        "iconPath": "/icons/user.png",
        "selectedIconPath": "/icons/user-active.png"
      }
    ]
  },
  /**
   * 组件的方法列表
   */
  methods: {
    getUserProfile(e){
      wx.getUserProfile({
        lang: 'zh_CN',
        desc: '用于用户登录后的头像和昵称设置',
        success(e) {
          console.log(e);
        }
      })
    },
    onChange(event) {
      const index = event.detail
      // event.detail 的值为当前选中项的索引
      wx.switchTab({
        url: this.data.list[index].pagePath
      })
    },
  }
})